import os
from building import *

# 获取当前目录
cwd = GetCurrentDir()
groups = []

# component
CPPPATH = []
src     = []
# ## LinkSDK\LinkSDK/components\bootstrap
# src += Glob('components/bootstrap/*.c')
# CPPPATH += [cwd + '/components/bootstrap']
# ## LinkSDK\LinkSDK/components\compress
# src += Glob('components/compress/*.c')
# CPPPATH += [cwd + '/components/compress']
# ## LinkSDK\LinkSDK/components\data-model
# src += Glob('components/data-model/*.c')
# CPPPATH += [cwd + '/components/data-model']
# ## LinkSDK\LinkSDK/components\devinfo
# src += Glob('components/devinfo/*.c')
# CPPPATH += [cwd + '/components/devinfo']
# ## LinkSDK\LinkSDK/components\diag
# src += Glob('components/diag/*.c')
# CPPPATH += [cwd + '/components/diag']
# ## LinkSDK\LinkSDK/components\logpost
# src += Glob('components/logpost/*.c')
# CPPPATH += [cwd + '/components/logpost']
# ## LinkSDK\LinkSDK/components\mqtt_upload
# src += Glob('components/mqtt_upload/*.c')
# CPPPATH += [cwd + '/components/mqtt_upload']
## LinkSDK\LinkSDK/components\ntp
# src += Glob('components/ntp/*.c')
# CPPPATH += [cwd + '/components/ntp']
# ## LinkSDK\LinkSDK/components\ota
# src += Glob('components/ota/*.c')
# CPPPATH += [cwd + '/components/ota']
# ## LinkSDK\LinkSDK/components\shadow
# src += Glob('components/shadow/*.c')
# CPPPATH += [cwd + '/components/shadow']
## LinkSDK\LinkSDK/components\subdev
src += Glob('components/subdev/*.c')
CPPPATH += [cwd + '/components/subdev']
# ## LinkSDK\LinkSDK/components\task
# src += Glob('components/task/*.c')
# CPPPATH += [cwd + '/components/task']
groups += DefineGroup('Linkkit/components', src, depend = [''], CPPPATH = CPPPATH)

# core
CPPPATH = []
src     = []
## LinkSDK\core\sysdep
src += Glob('core/sysdep/*.c')
CPPPATH += [cwd + '/core/sysdep']
## LinkSDK\core\utils
src += Glob('core/utils/*.c')
CPPPATH += [cwd + '/core/utils']
## LinkSDK\core
src += Glob('core/*.c')
CPPPATH += [cwd + '/core']
groups += DefineGroup('Linkkit/core', src, depend = [''], CPPPATH = CPPPATH)

# external
CPPPATH = []
src     = []
src += Glob('external/*.c')
## LinkSDK\external\libdeflate
src += Glob('external/libdeflate/lib/*.c')
CPPPATH += [cwd + '/external/libdeflate/lib']
CPPPATH += [cwd + '/external/libdeflate']
## LinkSDK\external\mbedtls
src += Glob('external/mbedtls/library/*.c')
CPPPATH += [cwd + '/external/mbedtls/include']
CPPPATH += [cwd + '/external/mbedtls/include/mbedtls']
groups += DefineGroup('Linkkit/external', src, depend = [''], CPPPATH = CPPPATH)

# portfiles
CPPPATH = []
src     = []
src += Glob('portfiles/aiot_port/*.c')
src += Glob('portfiles/aiot_port/at/*.c')
if GetDepend('GATEWAY_AT_DEVICE_USING_BC26'):
    src += Glob('portfiles/aiot_port/at/module/quectel_bc260y_tcp.c')
if GetDepend('GATEWAY_AT_DEVICE_USING_ESP8266'):
    src += Glob('portfiles/aiot_port/at/module/esp8266_tcp.c')
CPPPATH += [cwd + '/portfiles/aiot_port/at']
CPPPATH += [cwd + '/portfiles/aiot_port']
groups += DefineGroup('Linkkit/portfiles', src, depend = [''], CPPPATH = CPPPATH)

# samples
# CPPPATH = []
# src     = []
# src += Glob('samples/mqtt_basic_demo.c')
# src += Glob('samples/subdev_basic_demo.c')
# groups += DefineGroup('Linkkit/samples', src, depend = [''], CPPPATH = CPPPATH)

Return('groups')
